<?php
namespace common\models;

use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;

/**
 * 信任经纪人数据模型
 * @author wj
 */
class ARTrustBroker extends ActiveRecord
{

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
        ];
    }

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%trust_broker}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['broker_id', 'epithet'], 'safe'],
        ];
    }

    /**
     * 获取用户信息
     */
    public function getUser()
    {
        return $this->hasOne(ARUser::className(), ['id' => 'uid']);
    }
}
